<template>
  <div class="switch">
    <el-table :data="title" @row-click="article">
      <el-table-column prop="title">
        <template slot-scope="scope">
          <i class="arrow el-icon-arrow-right"></i>
          {{ scope.row.title }}
        </template>
      </el-table-column>
    </el-table>
    <el-button
      type="primary"
      @click="gomedia"
      style="background-color: #084fb0; border-color: #084fb0"
    >
      查看更多
    </el-button>
  </div>
</template>
<script>
import { contentmedia } from "@/api";
export default {
  name: "Media",
  data() {
    return {
      title: [],
    };
  },
  created() {
    contentmedia().then((res) => {
      const data = res.data;
      this.title = data.slice(0, 5);
    });
  },
  methods: {
    gomedia() {
      this.$emit("media", false);
      this.$router.push({
        path: "/more-text",
        query: { key: "媒体水院", more: 4, article: 0, apinum: 3 },
      });
    },
    article(row, event, column) {
      window.location.href = row.link;
    },
  },
};
</script>
<style>
.switch .el-table .cell {
  line-height: 0.68rem !important;
  height: 0.68rem;
  width: 88%;
  margin-left: 0.6rem;
  font-size: 0.56rem;
  white-space: nowrap;
}
</style>
